﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ProtocolVN.Framework.Win
{
    public class RBTaoPhieuXuatKhoToPYCGC:RangBuocRule
    {
        long PHIEU_ID;
        PhieuType loaiPhieuNguon;
        PhieuType loaiPhieuDich;
        long Kho_ID;
        #region RangBuocRule Members

        public RBTaoPhieuXuatKhoToPYCGC(long PHIEU_ID, PhieuType loaiPhieuNguon, PhieuType loaiPhieuDich,long Kho_ID)
        {
            this.PHIEU_ID = PHIEU_ID;
            this.loaiPhieuNguon = loaiPhieuNguon;
            this.loaiPhieuDich = loaiPhieuDich;
            this.Kho_ID=Kho_ID;
        }

        public List<InvalidInfo> Check()
        {
            List<InvalidInfo> ret = new List<InvalidInfo>();
            if (HelpPhieuLienQuan.DaTaoPhieu(PHIEU_ID, loaiPhieuNguon, loaiPhieuDich,Kho_ID) == true)
            {
                ret.Add(new InvalidInfo("Bạn đã tạo ra " + loaiPhieuDich.GetTitle() + " từ phiếu này rồi.",
                    "...", InvalidInfo.InvalidType.ERROR));
            }
            return ret;
        }

        #endregion
    }
}
